/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.myfaces.extensions.cdi.forge.api;

import org.jboss.forge.project.dependencies.DependencyBuilder;

/**
 * @author Cosmin Martinconi, 29.06.2011
 */
public enum CodiModule {

    CODI_CORE(new CodiDependency( "CODI core",
            DependencyBuilder.create().setGroupId("org.apache.myfaces.extensions.cdi.core").setArtifactId("myfaces-extcdi-core-api"),
            DependencyBuilder.create().setGroupId("org.apache.myfaces.extensions.cdi.core").setArtifactId("myfaces-extcdi-core-impl")
    )),

    JSF_MODULE(new CodiDependency( "CODI JSF module",
                new CodiDependency[]{
                    new CodiDependency("CODI JSF 1.2 module", "myfaces-extcdi-jsf12-module-api", "myfaces-extcdi-jsf12-module-impl"),
                    new CodiDependency("CODI JSF 2.0 module", "myfaces-extcdi-jsf20-module-api", "myfaces-extcdi-jsf20-module-impl")
    })),
    BV_MODULE(new CodiDependency("CODI Bean-Validation(JSR-303) module", "myfaces-extcdi-bv1-module-api", "myfaces-extcdi-bv1-module-impl")),
    SCRIPTING_MODULE(new CodiDependency("CODI Scripting(JSR-223) module", "myfaces-extcdi-scripting-module-api", "myfaces-extcdi-scripting-module-impl")),
    MESSAGE_API_MODULE(new CodiDependency("CODI Message(Advanced I18N) module", "myfaces-extcdi-message-module-api", "myfaces-extcdi-message-module-impl")),

    ALL_IN_ONE(new CodiDependency( "CODI All-in-one bundle",
                new CodiDependency[]{
                    new CodiDependency("CODI JSF 1.2 bundle",
                            DependencyBuilder.create().setGroupId("org.apache.myfaces.extensions.cdi.bundles").setArtifactId("myfaces-extcdi-bundle-jsf12"),
                            null),
                    new CodiDependency("CODI JSF 2.0 bundle",
                            DependencyBuilder.create().setGroupId("org.apache.myfaces.extensions.cdi.bundles").setArtifactId("myfaces-extcdi-bundle-jsf20"),
                            null),
                }));

    private CodiDependency dependency;

    CodiModule(CodiDependency dependency) {
        this.dependency = dependency;
    }

    public CodiDependency getDependency() {
        return dependency;
    }

    @Override
    public String toString() {
        return dependency.getDescription();
    }
}
